<template>
  <div class="page-content-wrapper">
    <div class="register-box">
      <div class="title">欢迎注册仙玩云手机</div>
      <div class="toLogin" @click="toLogin()">已有帐号? 去登录</div>
      <form class="form-horizontal">
        <div class="form-group">
          <div class="form-label">
            <span class="star">*</span>
            <span class="label">手机号码</span>
          </div>
          <input class="col-md-8 form-control" placeholder="请输入手机号">
        </div>
        <div class="form-group">
          <label class="form-label">
            <span class="star">*</span>
            <span class="label">验证码</span>
          </label>
          <input class="col-md-6 form-control" placeholder="请输入图形验证码">
          <div class="chart-verify"></div>
        </div>
        <div class="form-group">
          <label class="form-label">
            <span class="star">*</span>
            <span class="label">短信验证码</span>
          </label>
          <input class="col-md-6 form-control" placeholder="请输入短信验证码">
          <div class="sms-verify"></div>
        </div>
        <div class="form-group">
          <label class="form-label">
            <span class="star">*</span>
            <span class="label">登录密码</span>
          </label>
          <input class="col-md-8 form-control" placeholder="请输入登录密码">
        </div>
        <div class="form-group">
          <label class="form-label">
            <span class="star">*</span>
            <span class="label">确认密码</span>
          </label>
          <input class="col-md-8 form-control" placeholder="请再次输入登录密码">
        </div>
        <div class="protocol-group">
          <div class="center-group">
            <input type="checkbox">
            <div class="intro-group">
              我已阅读并同意
              <span class="intro" @click="showRegisterDialog('privacy')">《隐私政策》</span>和
              <span class="intro" @click="showRegisterDialog('service')">《服务条款》</span>
            </div>
          </div>
        </div>
        <div class="button-group">
          <button class="btn btn-primary btn-block">注册</button>
        </div>
      </form>
    </div>
    <register-dialog v-if="registerDialog" :data="dialogInfo"></register-dialog>
  </div>
</template>

<script>
import RegisterDialog from "./dialog/RegisterDialog";
export default {
  components: {
    RegisterDialog
  },
  data() {
    return {
      dialogInfo: {}
    };
  },
  computed: {
    registerDialog() {
      return this.$store.state.registerDialog;
    }
  },
  methods: {
    //返回登录
    toLogin() {
      this.$router.push({ path: "/" });
    },
    //显示提示窗口
    showRegisterDialog(type) {
      this.$store.commit("setDialogStatus", {
        dialog: "registerDialog",
        isBoolean: true
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.page-content-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  padding-top: 8%;
  box-sizing: border-box;
  background: url(../../static/img/register-background.png) no-repeat;
  background-size: cover;
  .register-box {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    top: 40%;
    transform: translateY(-50%);
    background-color: #fff;
    padding: 40px 20px;
    .title {
      font-size: 24px;
      text-align: center;
      margin-bottom: 40px;
    }
    .toLogin {
      position: absolute;
      cursor: pointer;
      right: 38px;
      top: 46px;
      color: #3a5a7a;
    }
    .form-horizontal {
      .form-group {
        display: flex;
        flex-direction: row;
        margin-bottom: 22px;
        .form-label {
          box-sizing: border-box;
          width: 150px;
          text-align: right;
          height: 40px;
          line-height: 40px;
          padding-right: 15px;
          box-sizing: border-box;
          .star {
            color: red;
          }
        }
        .form-control {
          height: 40px;
          line-height: 40px;
          max-width: 450px;
        }
        .chart-verify,
        .sms-verify {
          margin-left: 10px;
          width: 80px;
          height: 40px;
          background-color: red;
        }
      }
      .protocol-group {
        position: relative;
        margin-bottom: 22px;
        .center-group {
          position: relative;
          display: flex;
          width: fit-content;
          height: 40px;
          left: 50%;
          transform: translateX(-50%);
          input {
            margin-top: 5px;
            margin-right: 5px;
          }
          .intro-group {
            .intro,
            .intro {
              cursor: pointer;
              color: #3a5a7a;
            }
          }
        }
      }
      .button-group {
        margin-left: 23%;
        button {
          width: 70%;
        }
      }
    }
  }
}
</style>